package bibaokelihua;

import cn.hutool.core.collection.CollUtil;

import java.util.List;

public class Test {
    @FunctionalInterface
    interface StepOne {
        StepTwo apply(int stepOneValue);
    }

    @FunctionalInterface
    interface StepTwo {
        StepThree apply(int stepTwoValue);
    }

    @FunctionalInterface
    interface StepThree {
        List<Integer> apply(int stepThreeValue);
    }

    public static void main(String[] args) {
        List<Integer> resultList = CollUtil.newArrayList();

        StepOne stepOne = stepOneValue -> stepTwoValue -> stepThreeValue -> {
            resultList.add(stepOneValue);
            resultList.add(stepTwoValue);
            resultList.add(stepThreeValue);

            return resultList;
        };

        System.out.println("开始执行第1步。。。");
        StepTwo stepTwo = stepOne.apply(1);
        System.out.println("开始执行第2步。。。");
        StepThree stepThree = stepTwo.apply(2);
        System.out.println("开始执行第3步。。。");
        List<Integer> apply = stepThree.apply(3);
        System.out.println(apply);
        System.out.println("执行结束。。。");
    }
}
